import instance from '@/utils/request'

//获取员工简单列表
export function getEmployeesAllListApi (params) {
  return instance({
    url: '/sys/user',
    params
  })
}

//新增员工
export function addEmployeesAllListApi (data) {
  return instance({
    url: '/sys/user',
    method: 'POST',
    data
  })
}

//批量导入员工
export function addAllUserApi (data) {
  return instance({
    url: '/sys/user/batch',
    method: 'POST',
    data
  })
}

//保存员工基本信息
export function setUserDetailById (data) {
  return instance({
    url: `/sys/user/${data.id}`,
    method: 'PUT',
    data
  })
}

//给员工分配角色
export function setRoleApi (data) {
  return instance({
    url: `/sys/user/assignRoles`,
    method: 'PUT',
    data
  })
}
